<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<% String path=request.getContextPath(); String basePath=request.getScheme()+ "://" + request.getServerName() + ":" + request.getServerPort() + path+ "/"; %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<title>激活卡激活</title>
<%@ include file="/WEB-INF/jsp/common/common.jsp"%>
<script src="js/jquery.divbox.js" type="text/javascript"></script>
<style>
	.class-list-item-text {
		width: 214px;
		min-height: 100px;
		height: 100px;
		_height: 100px;
		border: 1px dashed #e9e9e9;
		background-color: #ccc;
		display: table;
		_position: relative;
		overflow: hidden;
	}
	.dialogTitle {
	    height: 31px;
	    line-height: 31px;
	    padding-left: 10px;
	    color: #333;
	    font-weight: bold;
	    font-size: 14px;
	    text-align:center
    }
    .search_table td.align_center {
        text-align: center;
    }
    .search_table td .input_button_2 {
        background: url(<%=path%>/images/button-zdy.png) no-repeat;
        background-size: cover;
    }
</style>
<script type="text/javascript">
    $(function (){
        $('#cardNo').val('')
        $('#cardPassWord').val('')
    });
    //打开卡号密码登录div
    function openLoginDiv(flag){
    	$("#flag").val(flag);
        $("#editLoginDiv").OpenDiv();
    }
    //验证用户名和密码
    function saveCardNo(){
        var cardNo=$("#cardNo").val();
        var password=$(".password").val();
        if(cardNo.length==0){
            $.message("error", "请输入卡号");
            return;
        }
        if(password.length==0){
            $.message("error", "请输入密码");
            return;
        }
        var flag=$("#flag").val();
        $.openLoading();
        $.ajax({
            url : "activatedCard/login",
            type : 'POST',
            async : true,
            dataType:'json',
            data:{cardNo:cardNo,password:password,flag:flag},
            success : function(result) {
                $.closeLoading();
                if("success"==result.result&&""!=result.message){
                    $.openLoading();
                    if(flag == '1'||'1'==result.data.type) {
                        window.location.href='<%=path%>/activatedCard/single/add';
                    }else if(flag == '2'){
                        window.location.href='<%=path%>/activatedCard/group/add';
                    }
                }
                if("fail"==result.result){
                    $.message("error", "系统错误,请联系管理员");
                }
                if("error"==result.result&&""!=result.message){
                    $.message("error", result.message);
                }
            }
        });
    }
    //关闭小窗口
    function closeDiv(obj){
    	$("#"+obj).CloseDiv();
    }
    //批量激活页面
    function batchActivation(){
    	$.openLoading();
        $.ajax({
            url : "activatedCard/batch/add",
            type : 'POST',
            async : true,
            success : function(result) {
                $.closeLoading();
                window.location.href='<%=path%>/activatedCard/batch/add'
            }
        });
    }
    function nlifeGroup(){
    	window.location.href='<%=path%>/activatedCard/group/add';
    }
    // lfd added 20181118 清空卡号密码
    function closeDivEditLoginDiv() {
    	closeDiv('editLoginDiv')
    	$('#cardNo').val('')
    	$('#cardPassWord').val('')
    }
</script>
</head>
<body>
	<div class="current">
		<table class="current_table_1">
			<tbody>
				<tr class="f2">
					<td><img src="./images/current_1.jpg"></td>
					<td class="current_table_1_td"><img src="images/current_1.png">&nbsp;您现在的位置：&nbsp;
						<span style="color: #136bab;">激活卡管理 <span
							style="padding: 0 5px; font-weight: bold; line-height: 28px;">&gt;</span>
							激活卡激活
					</span></td>
					<td><img src="./images/current_3.jpg"></td>
				</tr>
			</tbody>
		</table>
	</div>
	<table class="table_02" id="table">
	   <tr>
            <td>
                <table class="search_table">
                    <tr height="30px">
                        <td width="33%" height="30" class="align_center">
                            <input type="button"
                                class="input_button_2" value="个单投保"
                                onClick="openLoginDiv('1')" /> 
                        </td>
                        <td width="33%" height="30" class="align_center">
                            <input type="button"
                                class="input_button_2" value="批量激活"
                                onClick="batchActivation()" /> 
                        </td>
                        <td height="30" width="33%" class="align_center">
                            <input type="button"
                                class="input_button_2" value="团单投保" style="width:95px"
                                onClick="openLoginDiv('2')" /> 
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
	</table>
	<!--       添加模板 DIV 默认隐藏-->
    <div id="editLoginDiv" style="display:none;overflow-y:auto; width:60%">
    <input id="flag" type="hidden" />
	    <div class="table_title_div">
	       <table class="table_title" style='width:100%;height: 20px;'>
	           <tr>
	           <td width="10%"></td>
	           <td width="80%" id="interfaceName"></td>
	           <td width="10%" align="right"><img src="<%=path%>/images/closedown.gif" alt="关闭"  onclick="closeDivEditLoginDiv()"/></td>
	           </tr>
	       </table>
	    </div>
	    <div class="dialogTitle">
                                卡号密码验证
        </div>
	    <table id="addtempletTable" style="align:center;margin: 10px auto;border:0">
            <tbody>
                <tr>
                    <td>
                        <table id="coverageTable" class="content_table_1" border="0" align="center">
                            <tbody>
                                <tr style="text-align:center">
                                  <td width="40%" style="text-align:right;border-right:0px;">卡号：&nbsp;&nbsp;</td>
                                  <td width="60%" style="text-align:left"><input id="cardNo" name="cardNo" style="width: 200px" class="input_text" autocomplete="off"/></td>
                                </tr>
                                <tr style="text-align:center">
                                  <td width="40%" style="text-align:right;border-right:0px;">密码：&nbsp;&nbsp;</td>
                                  <td width="60%" style="text-align:left"><input id="cardPassWord" type="password" style="width: 200px" class="password input_text" autocomplete="off"/></td>
                                </tr>
                            </tbody>
                        </table>
                        
                    </td>
                </tr>
            </tbody>
        </table>
        <div align="center">
           <input class="input_button_3" name="" type="button" onclick="saveCardNo()" value="确定">&nbsp;&nbsp;
           <!-- lfd added 20181118 清空卡号密码 -->
           <!-- <input class="input_button_3" name="" type="button" onclick="closeDiv('editLoginDiv')" value="取消"> -->
           <input class="input_button_3" name="" type="button" onclick="closeDivEditLoginDiv()" value="取消">
        </div>
    </div>
	<div id="Loading" style="display: none" align="center">
		<img src="./images/loading.gif" />
	</div>
</body>
</html>